import { View, Text, StyleSheet, Image } from "react-native";

export type Props = {
  errTip: string;
}

// 错误提示
const ErrTip = (props: Props) => {
  return (
    <View style={styles.errtipContainer}>
      <View style={styles.itemContainer}>
        <Image style={styles.errImg} source={require("@/public/img/play-err.png")} resizeMode="contain" />
      </View>
      <View style={styles.itemContainer}>
        <Text style={[styles.errText, { marginTop: 10, marginBottom: 10 }]}>(＞﹏＜) 视频播放出错了~</Text>
        <Text style={styles.errText}>{props.errTip}</Text>
      </View>
    </View>
  );
};

const styles = StyleSheet.create({
  errtipContainer: {
    width: "100%",
    height: "100%",
    backgroundColor: "#000",
  },
  errImg: {
    width: "70%",
    height: "70%",
  },
  itemContainer: {
    justifyContent: "center",
    alignItems: "center",
    // backgroundColor: "yellow"
  },
  errText: {
    color: "#fff",
    fontSize: 28,
  },
});

export default ErrTip;